from django.contrib import admin
from django.urls import path

import houtai
from houtai import views
from rest_framework_simplejwt.views import TokenObtainPairView
from rest_framework import routers


urlpatterns = [
    # path('admin/', admin.site.urls),
    # path('login/',views.Login.as_view(),name='list'),
    #登录
    path('login/', TokenObtainPairView.as_view(), name='token_obtain_pair'),
    path('houtailist/', views.HouTaiList.as_view(), name='houtailist'),
    path('adminlist/', views.HouTai.as_view({'get':'list','post':'create'}), name='adminlist'),
    path('adminlist/<int:pk>/', views.HouTai.as_view({'put':'update','delete':'destroy','get':'retrieve'}), name='admindetail'),
    path('uploadimg/', views.UpLoadImg.as_view(), name='uploadimg'),
    path('uploadimg/<int:pk>/', views.UpLoadImg.as_view(), name='uploadimgsc'),

]

# router = routers.DefaultRouter()
# router.register('admin',houtai.views.HouTai,basename='admin')
# print(router.urls)
# urlpatterns += router.urls
# print(urlpatterns)